import React, { Component } from 'react'
import { observer } from 'mobx-react'
import { observable } from 'mobx'
import Style from './style.module.less'

let appState = observable({
    count: 0
})
@observer
class noteMobX extends Component {
    UNSAFE_componentWillMount() {
        // const name = 'wxy'
        // console.log('name', name)
    }
    tick = () => {
        console.log('点击了一下')
        console.log('appState.count', appState.count)
        appState.count++
        console.log('appState.count', appState.count)
    }
    render() {
        return (
            <>
                <h2>{appState.count}</h2>
                <div className={Style.buttonDiv} onClick={this.tick}>点击一下</div>
            </>
        )
    }
}

export default noteMobX